In [1]:
from IPython.display import Image
from IPython.core.display import HTML
from IPython.display import IFrame

image.png

image.png

image.png

image.png

image.png

image.png

image.png

In [6]:
IFrame(src="https://yongdanielliang.github.io/animation/web/Stack.html",
       width='100%',
       height='600px')
Out[6]:

image.png

image.png

In [2]:
import java.util.ArrayList;

public void exStackng() {
    
    Stack s = new Stack();
    s.push("A");
    s.push("B");
    s.push("C");
    System.out.println(s);
    System.out.println(s.search("A"));
    System.out.println(s.search("B"));
    System.out.println(s.search("Z"));
}
In [3]:
exStackng()
[A, B, C]
3
2
-1

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

In [ ]:
from IPython.display import YouTubeVideo

YouTubeVideo('JhhSuXzrGgg', width = 800, height=600)

image.png

image.png

In [9]:
IFrame(src="http://btv.melezinek.cz/binary-search-tree.html",
       width='100%',
       height='800px')
Out[9]:

image.png

image.png

In [3]:
IFrame(src="http://btv.melezinek.cz/binary-search-tree.html",
       width='100%',
       height='800px')
Out[3]:

Tree traversal - DFS vs BFS

In [2]:
IFrame(src="https://miro.medium.com/max/1000/1*Js-o5Lsxh7v0DmTmsLavTg.gif", width = '1100px', height = '600px')
Out[2]:

image.png

In [ ]:
 
In [ ]:
 

image.png

image.png

image.png

Inorder Traversal

Go to left-subtree

Visit Node

Go to right-subtree

In [4]:
IFrame(src="https://miro.medium.com/max/625/1*bxQlukgMC9cGv_MFUllX2Q.gif", width = '1100px', height = '600px')
Out[4]:

Preorder Traversal

Visit Node

Go to left-subtree

Go to right-subtree

In [3]:
IFrame(src="https://miro.medium.com/max/625/1*UGoV21qO6N8JED-ozsbXWw.gif", width = '1100px', height = '600px')
Out[3]:

Postorder Traversal

Go to left-subtree

Go to right-subtree

Visit Node

In [5]:
IFrame(src="https://miro.medium.com/max/625/1*UGrzA4qtLCaaCiNAKZyj_w.gif", width = '1100px', height = '600px')
Out[5]:

image.png

image.png

Remove Node

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

In [12]:
IFrame(src="https://visualgo.net/en/bst",
       width='100%',
       height='1000')
Out[12]:

image.png

In [ ]:
IFrame(src="https://visualgo.net/en/bst", width = '1200px', height = '800px')